/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: offline build cluster info parse
 * Author: wangke
 * Create: 2022-10-09
 */

#ifndef OFFLINE_BUILD_CONFIG_PARSE_H
#define OFFLINE_BUILD_CONFIG_PARSE_H
#include <string>
#include <vector>
#include "comm.h"
#include "topoinfo_ranktableOffline.h"
#include "graph/utils/node_utils.h"

namespace hccl {
constexpr u32 MINUS_MESH_STREAM_NUM = 2;
HcclResult GetOffDeviceTypeWithoutDev(DevType &devType);
HcclResult GetStreamNumOfflineComp(const std::string &sCollectiveType, const std::string curGroup, u64 &streamNum);
HcclResult GetAllReduceScratchSizeWithoutDev(const std::string &sGroup, const ge::Node& node, s32 serverNum,
    s32 rankSize, const u64 count, const HcclDataType dataType, u64 &scratchSize);
HcclResult GetClusterInfoAndDeviceNum(RankTable_t &clusterInfo, s32 &deviceNum);
HcclResult GetDeviceAndServerNumFromGroupList(const std::string &groupListString, const std::string groupName,
    s32 &serverNum, s32 &deviceNumPerServer, bool &multiModuleDiffDeviceNumMode);
HcclResult GetSubStreamNum(s32 deviceNum, u64 &streamNum, s32 &serverNum);
HcclResult GetServerAndDevNumFromGroup(const std::vector<u32> &groupRanks, s32 &serverNum, s32 &deviceNum,
    bool &multiModuleDiffDeviceNumMode);
bool IsOfflineCompilation();
HcclResult GetDeterministic(bool &isDeterministic);
}

#endif /* OFFLINE_BUILD_CONFIG_PARSE_H */
